package controllers;
import java.util.Date;

import models.*;

public class Security extends Secure.Security
{
	static boolean authentify(String pseudo, String password) 
	{
		return Utilisateur.connect(pseudo, password) != null;
    }
	
	static void onDisconnected()
	{
		Application.index();
	}
	
	static void onAuthentificated()
	{
		Application.index();
	}
	
	static boolean check(String profile)
	{
		if("admin".equals(profile))
		{
			return Utilisateur.find("byPseudo", connected()).<Utilisateur>first().is_admin;
		}
		return false;
	}	
}
